#include "Constant.h"


Constant::Constant(Token *_tok)
    : Expr(_tok)
{
    if (token->Tag() == NUM)
    {
        type = INT;
    }
    else if (token->Tag() == REAL)
    {
        type = FLT;
    }
    else
    {
        assert(0);
    }
}


Constant::~Constant(void)
{
}

int Constant::DoEvalInt()
{
    return token->GetIntProp();
}

float Constant::DoEvalFlt()
{
    return token->GetFltProp();
}
